/*
 * Created on 2006-3-14
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package com.hitrust.gs.vo;

import java.sql.ResultSet;
import java.sql.SQLException;

import com.hitrust.gs.service.GSBaseBean;
import com.hitrust.gs.util.lang.StringUtils;

/**
 * @author simonyi
 *
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
public class GSPayReceiveAbleStatusListVO implements GSBaseBean {

    //公司名称 费用类型 金额（元） 收（付）款日期 负责（联系）人 状态 
    public String workcorpid;
    public String deptname;
    public String paytype;
    public String paynum;
    public String paydate;
    public String principal;
    public String paystatus;
        
    public Object process(ResultSet aResultSet) throws SQLException {
        GSPayReceiveAbleStatusListVO vo = new GSPayReceiveAbleStatusListVO();
        
        vo.workcorpid = aResultSet.getString("P1");
        vo.deptname = aResultSet.getString("P2");
        if("990".equals(aResultSet.getString("P9")) || "991".equals(aResultSet.getString("P9"))){
            vo.paytype = aResultSet.getString("P9").equals("990")?"预收款":"预付款";    
        }else{
            vo.paytype = aResultSet.getString("P3");    
        }
        
        vo.paynum = StringUtils.formatEDouble(aResultSet.getDouble("P4"),4);
        vo.paydate = aResultSet.getString("P5");
        vo.principal = aResultSet.getString("P6");
        if("990".equals(aResultSet.getString("P9")) || "991".equals(aResultSet.getString("P9"))){
            vo.paystatus = "";
        }else{
            vo.paystatus = "1".equals(aResultSet.getString("P7"))?"未完成":("2".equals(aResultSet.getString("P7"))?"部分完成":"全部完成");    
        }
        

        return vo;
    }

}
